﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AL.Doodled
{
    internal class StyleState
    {
        #region fields
        Dictionary<string, dynamic> attributes;
        #endregion

        #region properties
        public dynamic this[string key]
        {
            get { return attributes[key]; }
        }

        /// <summary>
        /// Get the stylestates attribute keys.
        /// </summary>
        public string[] AttributeKeys
        {
            get { return attributes.Keys.ToArray(); }
        }
        #endregion

        #region constructor
        public StyleState()
        {
            attributes = new Dictionary<string, dynamic>();
        }
        #endregion

        #region methods
        /// <summary>
        /// Set the styles attributes after the states.
        /// </summary>
        /// <param name="style">The style that should be saturated.</param>
        public void SaturateStyle(Style style)
        {
        }

        /// <summary>
        /// Add the attribute to the StyleState, the current
        /// information will be edited if the key allready exists.
        /// </summary>
        /// <param name="key">The key of the attribute.</param>
        /// <param name="value">The atributes value.</param>
        public void AddAttribute(string key, dynamic value)
        {
            if (attributes.ContainsKey(key))
                attributes[key] = value;
            else
                attributes.Add(key, value);
        }
        #endregion
    }
}
